﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="../scripts/boot.js" type="text/javascript"></script>
    <title>查询</title>
    <script type="text/javascript">
        var State = [{ id: 1, text: '<font color="Blue">通过</font>' }, { id: 2, text: '<font color="Red">不通过</font>'}]
        var PayState = [{ id: 0, text: '未缴费' }, { id: 1, text: '已缴费' }, { id: -1, text: '已退回' }, { id: 2, text: '全部'}];
        var Types = [{ id: 0, text: '全部' }, { id: 1, text: '有效' }, { id: -1, text: '过期' }, { id: 2, text: '即将到期'}];
    </script>
</head>
<body>
    <h1>企业缴费明细</h1>
    <div id="toolbar1" class="mini-toolbar" style="padding:2px;">
    <table style="width:100%;">
        <tr>
        <td style="width:100%;">
            <a class="mini-menubutton" plain="true" menu="#popupMenu">文件</a>
            状态:
            <input id="state" style="width:90px" class="mini-combobox" data="PayState" value="0"/>
            <a class="mini-button" iconCls="icon-addfolder" plain="true" enabled="false">增加</a>
            <a class="mini-button" iconCls="icon-edit" plain="true">修改</a>
            <a class="mini-button" iconCls="icon-remove" plain="true">删除</a>
            <span class="separator"></span>
            <a class="mini-button" iconCls="icon-reload" plain="true">刷新</a>
            <a class="mini-button" iconCls="icon-download" plain="true">下载</a>
        </td>
        <td style="white-space:nowrap;"><label style="font-family:Verdana;">Filter by: </label>
            <input class="mini-textbox" />
            </td>
        </tr>
    </table>
</div>
    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width: 100%; height: 450px;" url="../data/payservice.aspx?method=GetPayInfo"
            idfield="id" allowresize="true" sizelist="[20,30,50,100]" pagesize="20" multiSelect="true">
            <div property="columns">
                <div type="checkcolumn">
                </div>
                <div field="cp_Id" name="cp_Id" width="120" headeralign="center" allowsort="true">
                    缴费编号</div>
                <div field="cp_cuno" width="70" headeralign="center" allowsort="true">
                    企业编号</div>
                <div field="cu_name" width="120" headeralign="center" allowsort="true">
                    企业名称</div>
                <div field="cp_applytime" width="100" align="center" headeralign="center" dateFormat="yyyy-MM-dd HH:mm:ss">
                    提交时间</div>
                <div field="cp_oktime" align="right" width="100" allowsort="true" headeralign="center">
                    收费确认时间</div>
                <div field="cp_canceltime" width="100" headeralign="center" allowsort="true">
                    取消时间</div>
                <div field="cp_psID" name="cp_psID" width="100" headeralign="center" allowsort="true">
                    服务条目编号</div>
                <div field="ps_name" width="100" headeralign="center" allowsort="true">
                    服务名称</div>
                <div field="ps_description" width="300" headeralign="center" allowsort="true">
                    服务内容</div>
                <div field="cp_paymoney" numberformat="¥#,0.00" width="120" headeralign="center" allowsort="true">
                    金额</div>
                <div field="cp_isapply" width="120" headeralign="center" allowsort="true" renderer="onStatusRenderer" >
                    提交状态</div>
                <div field="cp_ispay" width="120" headeralign="center" allowsort="true" renderer="isPayRenderer">
                    是否已支付</div>
                <!-- <div field="gender" width="100" renderer="onGenderRenderer" align="center" headerAlign="center">性别</div>
        <div field="salary" numberFormat="¥#,0.00" align="right" width="100" allowSort="true">薪资</div>                                -->
            </div>
        </div>
    </div>
    <button id = "btn">test</button>
    <script type="text/javascript">



        mini.parse();


        var grid = mini.get("datagrid1");


        grid.load();

        (function () {
            grid.hideColumn("cp_ID");
            grid.hideColumn("cp_psID");
        })();

        function test() { 
            
        }   
       

        function search() {
            var key = document.getElementById("key").value;
            grid.load({ key: key });
        }
        $("#key").bind("keydown", function (e) {
            if (e.keyCode == 13) {
                search();
            }
        });
        ///////////////////////////////////////////////////////
        var Genders = [{ id: 1, text: '男' }, { id: 2, text: '女'}];
        function onGenderRenderer(e) {
            for (var i = 0, l = Genders.length; i < l; i++) {
                var g = Genders[i];
                if (g.id == e.value) return g.text;
            }
            return "";
        }

        //提交状态显示
        function onStatusRenderer(e) {
            var s;
            if (e.cp_isapply == 0) {
                s = '<font color="Green">未提交</font>';
            }
            else if (e.cp_isapply == 1) {
                s = '<font color="Red">已提交</font>';
            }
            else if (e.cp_isapply == -1) {
                s = '<font color="Blue">已取消</font>';
            } else {
                s = '状态不正常！';
            }
            return s;
        }

        //收费显示
        function isPayRenderer(e) {
            var s;
            if (e.cp_ispay == 0) {
                s = '<font color="Red">未支付</font>';
            }
            else if (e.cp_ispay == 1) {
                s = '<font color="Green">已支付</font>';
            }
            else if (e.cp_ispay == -1) {
                s = '<font color="Blue">已退费</font>';
            } else {
                s = '<font color="Blue">已取消</font>';
            }
            return s;
        }
    </script>
</body>
</html>
